package com.kaigejava.factorypattern.method;

import com.kaigejava.factorypattern.method.domain.BeiJinGreekPizza;
import com.kaigejava.factorypattern.method.domain.BeiJinPepperPizza;
import com.kaigejava.factorypattern.method.domain.ShangHaiGreekPizza;
import com.kaigejava.factorypattern.method.domain.ShangHaiPepperPizza;

/**
 * Created by kaigejava on 2019/8/25.
 * 来自上海的披萨订单
 */
public class ShangHaiOrderPizza extends  PizzaOrderAbstract{
    @Override
    protected PizzaAbstract createPizza(String ordertype) {
        PizzaAbstract pizza = null;

        if (ordertype.equals("greek")) {
            pizza = new ShangHaiGreekPizza();
        } else if (ordertype.equals("pepper")) {
            pizza = new ShangHaiPepperPizza();
        }
        return pizza;
    }
}
